package com.info.zhiduoduo.repository.entity.crowdsource;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 智零工发票表
 */
@Data
@Accessors(chain = true)
@TableName("zdd_contractor_invoice")
public class ContractorInvoice extends Model<ContractorInvoice> {

    @TableId(value = "invoice_id", type = IdType.AUTO)
    private Integer invoiceId;
    /**
     * 智众包项目id
     */
    private Integer projectid;
    /**
     * 智众包项目item id
     */
    private Integer projectItemId;
    /**
     * 项目名称
     */
    @TableField("project_name")
    private String projectName;
    /**
     * 项目金额
     */
    @TableField("project_amount")
    private BigDecimal projectAmount;
    /**
     * 发单企业id
     */
    private Integer compid;
    /**
     * 发单企业名称
     */
    private String compname;
    /**
     * 开票状态（1：待开票，2：开票中，3：已开票,4:已作废）
     */
    private Integer state;

    /**
     * 作废理由
     */
    @TableField("invalidation_reasons")
    private String invalidationReasons;

    /**
     * 创建时间
     */
    private Date createtime;

    /**
     * 操作人
     */
    private Integer operator;

    /**
     * 更新时间
     */
    private Date updatetime;

    /**
     * 发票类型  1增值税票普通发票 2增值税专用发票
     */
    @TableField("invoice_type")
    private String invoiceType;

    /**
     * 开票内容
     */
    @TableField("invoice_content")
    private String invoiceContent;


    /**
     * 申请开票时选择的甲方企业id
     */
    @TableField("party_id")
    private Integer partyId;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 发票编号
     */
    @TableField("invoice_number")
    private String invoiceNumber;

    /**
     * 发票图片路径
     */
    @TableField("invoice_picture")
    private String invoicePicture;

    /**
     * 开票地id(成本发票使用 申请开票时客服选择)
     */
    @TableField("invoice_city_id")
    private Integer invoiceCityId;

    /**
     * 开票完成时间
     */
    @TableField("finishtime")
    private Date finishtime;

    /**
     * 开票金额
     */
    @TableField("invoiced_amount")
    private BigDecimal invoicedAmount;

    /**
     * 申请金额：实发金额+实发金额*税源地成本费率
     */
    @TableField("apply_amount")
    private BigDecimal applyAmount;

    private static final long serialVersionUID = 1L;

    @Override
    protected Serializable pkVal() {
        return this.invoiceId;
    }

}
